<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "t_area".
 *
 * @property string $id
 * @property string $parent_id
 * @property integer $level
 * @property string $area_name
 * @property string $simple_name
 * @property string $whole_name
 * @property string $area_code
 * @property string $zip_code
 * @property string $pre_pin_yin
 * @property string $pin_yin
 * @property string $simple_pin_yin
 * @property double $lon
 * @property double $lat
 * @property string $province_id
 * @property string $city_id
 * @property string $county_id
 * @property string $remark
 * @property string $area_code_5
 */
class Area extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 't_area';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['id'], 'required'],
            [['level'], 'integer'],
            [['lon', 'lat'], 'number'],
            [['remark'], 'string'],
            [['id', 'parent_id', 'area_name', 'simple_name', 'whole_name', 'area_code', 'zip_code', 'pre_pin_yin', 'pin_yin', 'simple_pin_yin', 'province_id', 'city_id', 'county_id'], 'string', 'max' => 255],
            [['area_code_5'], 'string', 'max' => 6],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'parent_id' => 'Parent ID',
            'level' => 'Level',
            'area_name' => 'Area Name',
            'simple_name' => 'Simple Name',
            'whole_name' => 'Whole Name',
            'area_code' => 'Area Code',
            'zip_code' => 'Zip Code',
            'pre_pin_yin' => 'Pre Pin Yin',
            'pin_yin' => 'Pin Yin',
            'simple_pin_yin' => 'Simple Pin Yin',
            'lon' => 'Lon',
            'lat' => 'Lat',
            'province_id' => 'Province ID',
            'city_id' => 'City ID',
            'county_id' => 'County ID',
            'remark' => 'Remark',
            'area_code_5' => 'Area Code 5',
        ];
    }
}
